﻿Public Class FrmErrorProvider

    Private Sub txtPrueba_Validating(sender As System.Object, e As System.ComponentModel.CancelEventArgs) Handles txtPrueba.Validating
        Try
            Dim i As Integer = CType(txtPrueba.Text, Integer)
            errorProvider.SetError(txtPrueba, Nothing)
        Catch ex As Exception
            e.Cancel = True
            errorProvider.SetError(txtPrueba, "Debe ser un número")
        End Try
    End Sub

    Private Sub FrmErrorProvider_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        webBrowser.Url = New Uri("http://msdn.microsoft.com/es-es/library/system.windows.forms.errorprovider(v=VS.80).aspx")
        rtbEjercicio.Text = My.Resources.ErrorProvider.Replace("\n", ControlChars.NewLine)
    End Sub
End Class
